d35d47188b5e80fc6ca804306f4e43aa236a6d85,src/main/java/openperipheral/addons/sensors/AdapterSensor.java,AdapterSensor,sonicScanTarget,#ISensorEnvironment#number#number#number#,256
Before Change
Vec3 sensorPos = env.getLocation();
final int rangeSq = range * range;
final int distSq = xOff * xOff + yOff * yOff + zOff * zOff;
if (distSq == 0 || distSq > rangeSq) return null;
final int bx = MathHelper.floor_double(sensorPos.xCoord) + xOff;
final int by = MathHelper.floor_double(sensorPos.yCoord) + yOff;
final int bz = MathHelper.floor_double(sensorPos.zCoord) + zOff;
final String type = getBlockType(env, bx, by, bz);
if (type == null) return null;
final int color = getBlockColorBitmask(env, bx, by, bz);
Map<String, Object> tmp = Maps.newHashMap();
tmp.put("x", xOff);
tmp.put("y", yOff);
tmp.put("z", zOff);
tmp.put("type", type);
tmp.put("color", color);
After Change
@ScriptCallable(returnTypes = ReturnType.TABLE, description = "Get a table of information about a single block in the surrounding area. Includes map color and whether each block is UNKNOWN, AIR, LIQUID, or SOLID.")
public Map<String, Object> sonicScanTarget(ISensorEnvironment env,
@Arg(name = "xOffset", description = "The target's offset from the sensor on the X-Axis.") int dx,
@Arg(name = "yOffset", description = "The target's offset from the sensor on the Y-Axis.") int dy,
@Arg(name = "zOffset", description = "The target's offset from the sensor on the Z-Axis.") int dz) {
int range = 1 + env.getSensorRange() / 2;
int rangeSq = range * range;
if (checkRange(dx, dy, dz, rangeSq)) return null;
Vec3 sensorPos = env.getLocation();
int sx = MathHelper.floor_double(sensorPos.xCoord);
int sy = MathHelper.floor_double(sensorPos.yCoord);
int sz = MathHelper.floor_double(sensorPos.zCoord);
return describeBlock(env.getWorld(), sx, sy, sz, dx, dy, dz);
}